<template>
  <div class="person">
    <h2>姓名:{{ name }}</h2>
    <h2>年龄:{{ age }}</h2>
    <button @click="showTel">查看联系方式</button>
  </div>
</template>

<script setup lang="ts">
export default {
  name: 'Person',
  data(){
    return {
      name: '张三',
      age:18,
      tel:'12345678901'
    }
  },
  methods:{
    showTel(){
      alert(this.tel);
    }
  }
}

</script>

<style lang="scss" scoped>
</style>
